-
Notifications
You must be signed in to change notification settings - Fork 26
add correlation functions #210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
... and 5 files with indirect coverage changes 🚀 New features to boost your workflow:
|
|
Am I right that this PR adds a specialized function to calculate In addition, sometimes its hard to split |
|
This was precisely the original discussion in one of the earlier PRs. I would prefer if we default to giving the two-body operator and split it up ourselves, ie always work with an auxiliary leg, because I don't like code that only works for non-symmetric cases |
|
Looking at this a bit more in depth: can we just mimick the MPSKit functions from this file? For example, I like that in MPSKit there is a distinction between specifying two For having the option to have different For the implementation I have more or less the same remarks, is there an option to define this in a similar way as MPSKit, using transfer matrices? I am guessing there might be some missing |
That's mainly why I added both options, because this way it works for symmetric tensors as well in the case where the operators have a product structure. If we want to have the correlation function of e.g. S_zz, we otherwise would have to give If we wouldn't allow product structure operators here, then maybe we also shouldn't allow them when we generalize this function to TL;DR I would prefer to keep both options open, but wouldn't mind to restrict it to 2-site operators or to make the function where we use 2 one-site operators with auxiliary legs an internal function. |
Is there a reason why the order is For the implementation: I indeed tried to mimic MPSKit as much as possible. I also implemented the variant of the TransferMatrix in this file on my fork, but I noticed that it is way less efficient then the other implementation, mainly because we have to create a 10-leg tensor here. I'll test tomorrow whether it becomes more efficient if I just take the power of the transfer matrix instead of taking the eigenvalue decomposition, but I doubt it... I do agree that it would be useful to specify either a number or a range, and in the former case the transfermatrix implementation might be more efficient. |
|
Just making sure we understand each other: the MPSKit implementation does not actually build the transfer matrix, it makes an object that holds the tensors that represent it, and the transfer functions only implement the actions of that transfer operator. In other words, it should more or less be the same implementation you have, just organized differently |
|
I now changed the code to be more closely related to how MPSKit does it, by defining transfer matrices and the function After thinking about it a little bit more, the order Any additional comments or suggestions are very much appreciated. |
lkdvos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't actually have to define your own transfer operators, the ones from MPSKit are generic enough so you can simply overload them. This is precisely how the boundary MPS code works, so there already are some transfer functions defined: see here.
I would therefore recommend to simply reuse MPSKit.TransferMatrix and go from there, this should reduce the number of transfer operations you have to define (and also reduce number of things to compile).
change to TransferMatrix as defined in MPSKit change the argument order of transfer_left to be compatible with MPSKit add function MPSKit.correlator that checks whether the correlation function is horizontal or vertical only export correlator
|
The VUMPS tests are now failing since I am overloading |
|
You can check the correlation length function for how this was calculated before, see PEPSKit.jl/src/algorithms/toolbox.jl Line 259 in c2a32f2
|
lkdvos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mind if I add some changes directly to this PR?
|
Sure, go ahead |
|
I updated the implementation to more closely resemble MPSKit's version, and tried to be a bit more generic with the input types. I also added some tests to ensure that the rotation is correctly handled, and that the range does not need to be contiguous (this is important when dealing with mixed physical spaces, where an operator might not even fit on each site). I repurposed the Let me know what you think about this. |
|
I'll try to use these functions for an iPEPS and CTMRGEnv with large bond dimensions and see if the memory usage is improved over the generic |
pbrehmer
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, thanks for the effort :-)
It would be nice to show these new correlator capabilities in one of the examples or perhaps write up a new example specifically on correlators. But let's do that in a separate PR. Maybe I'll just convert the new correlator tests into a commented example.
|
What happened with the codedev check? It reports 0% test coverage. |
ad4945f to
37ace4c
Compare
Sometimes it needs to rerun after all other checks have passed. Now it's back to 100% test coverage. |
This PR aims to add correlation functions for an
InfinitePEPS. The aim is to extend this toInfinitePartitionFunctions andInfinitePEPOs. This extension would use 'excited' partition functions, the use of which is discussed in #117.The preferred user interface and implementation are open for discussion. Once we have reached a consensus, I'll add the vertical correlators.